package plane;

import com.sun.tools.javac.Main;
import mainwindow.Window;
import reward.AddScore;
import reward.Reward;

public class Bee extends FlyingObject implements Reward{
    private int speed = 2;
    private int speed_x = 2;
    private int rewardType = (int)(Math.random()*2);

    public Bee(){
        image = Window.bee;
        imageHeight = image.getHeight();
        imageWidth = image.getWidth();
        x = (int)(Math.random() * (Window.WIDTH - imageWidth));
        y = -imageHeight;
        health = 3;
    }

    @Override
    public void move() {
        if (x > Window.WIDTH - this.imageWidth + 1){
            speed_x = -2;
        }
        if (x < 0){
            speed_x = 2;
        }
        x += speed_x;
        y += speed;
    }


    @Override
    public int rewardType() {
        return this.rewardType;
    }
}
